﻿using System;

namespace Oxage.Services
{
	public class BuildService
	{
		public static IProjectBuilder CurrentProjectBuilder
		{
			get;
			set;
		}

		public static void CheckCode()
		{
			if (CurrentProjectBuilder != null)
			{
				var result = CurrentProjectBuilder.Build();
				foreach (var error in result.Errors)
				{
					LoggingService.WriteLine("<error> " + error);
				}
				foreach (var warning in result.Warnings)
				{
					LoggingService.WriteLine("<warning> " + warning);
				}
				foreach (var info in result.Info)
				{
					LoggingService.WriteLine("<info> " + info);
				}
			}
		}
	}
}
